<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>数据库设计API</title>
    <link href="https://cdn.bootcss.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
    <div class="panel">
        <div class="panel-heading text-center">
            <br/><br/>
            <p class="text-center"><h4>数据库设计文档</h4></p>
            <br/>
        </div>
    </div>
    <div class="panel">
        <div class="panel-heading">
            <p><h4>一、数据库类型</h4></p>
        </div>
        <div class="panel-body">
            <p><h5 class="col-lg-12">${databaseType}</h5></p>
        </div>
    </div>
    <div class="panel">
        <div class="panel-heading">
            <p><h4>二、系统名称</h4></p>
        </div>
        <div class="panel-body">
            <p><h5 class="col-lg-12">${sysObj.sysCname}</h5></p>
        </div>
    </div>
    <div class="panel">
        <div class="panel-heading">
            <p><h4>三、数据表汇总</h4></p>
        </div>
        <div class="panel-body">
            <table class="table table-bordered table-hover">
                <thead class="bg-danger">
                <tr>
                    <th>序号</th>
                    <th>表英文名称</th>
                    <th>表中文名称</th>
                </tr>
                <tbody>
                <#list tableList as obj>
                <tr>
                    <td>${obj_index+1}</td>
                    <td>${obj.infoTableName}</td>
                    <td>${obj.sortName}</td>
                </tr>
                </#list>
                </tbody>
            </table>
        </div>
    </div>
    <div class="panel">
        <div class="panel-heading">
            <p><h4>四、数据表详细设计</h4></p>
        </div>
        <div class="panel-body">

        <#list tableList as obj>
            <div class="panel">
                <div class="panel-heading">
                    <p><h5>${obj_index+1}.${obj.sortName}-${obj.infoTableName}</h5></p>
                </div>
                <div class="panel-body">
                    <table class="table table-bordered table-hover">
                        <thead class="bg-warning">
                        <tr>
                            <th>序号</th>
                            <th>字段英文名</th>
                            <th>字段中文名</th>
                            <th class="text-center">数据类型</th>
                            <th class="text-center">长度</th>
                            <th class="text-center">约束</th>
                            <th class="text-center">备注</th>
                        </tr>
                        <tbody>
                            <#assign items=fieldListMap[obj.sortId]/>
                            <#list items as obj2>
                            <tr>
                                <td>${obj2_index+1}</td>
                                <td>${obj2.dataShortName!''}</td>
                                <td><#if obj2.dataFullName??>${obj2.dataFullName?replace('&','&amp;')?replace('<','&lt;')?replace('>','&gt;')?replace('\'','&apos;')?replace('\"','&quot;')}</#if></td>
                                <td class="text-center">${fieldTypeMap[obj2.dataType]}</td>
                                <td class="text-center">${obj2.dataLength!''}</td>
                                <td class="text-center">${fieldConstraintMap[obj2.dataRestrict]}</td>
                                <td class="text-center">&nbsp;</td>
                            </tr>
                            </#list>
                        </tbody>
                    </table>

                </div>
            </div>
        </#list>

        </div>
    </div>

</div>
</body>
</html>